package util;

import javax.servlet.http.*;

import model.CompanyModel;
import model.DocumentModel;

public class SessionUtil {

	public static final String keyComany = "comany";
	public static final String keyDocument = "document";

	public static void saveCompany(HttpServletRequest request, CompanyModel obj) {
		HttpSession session = request.getSession(true);
		session.setAttribute(keyComany, obj);
	}

	public static CompanyModel getCompany(HttpServletRequest request) {
		HttpSession session = request.getSession(true);
		CompanyModel obj = (CompanyModel) session.getAttribute(keyComany);
		return obj;
	}

	public static void saveDocument(HttpServletRequest request,
			DocumentModel obj) {
		HttpSession session = request.getSession(true);
		session.setAttribute(keyDocument, obj);
	}

	public static int getCurrentUserID() {
		// TODO Auto-generated method stub
		return 0;
	}

}